﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace DeviceSync
{
	[ServiceContract(Namespace = "http://www.ecclescollege.ac.uk/sync")]
	public interface ISyncService
	{
		[OperationContract]
		int SendFileRec(string filename, DateTime lastchange);

		[OperationContract]
		string SendFragment(int fileid, int fragment, byte[] data, int datasize);

		[OperationContract]
		void CloseFile(int fileid);

		[OperationContract]
		Version ClientVersion();

		[OperationContract]
		DateTime ServerTime();


		// Wrapper methods - less 'pure' but reduce round-trips

		[OperationContract]
		void StartupChecks(out DateTime servertime, out Version requiredversion);

		[OperationContract]
		string SendFragmentClosure(int fileid, int fragment, byte[] data, int datasize, bool closeafter);

		[OperationContract]
		void SendFragmentHashClosure(int fileid, int fragment, byte[] data, int datasize, string hashcheck, bool closeafter);
	}
}
